import 'package:flutter/material.dart';
import 'package:flutter_plugin/flutter_plugin.dart';

void main() => runApp(new MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => new _MyAppState();
}

class _MyAppState extends State<MyApp> {

  @override
  void initState() {
    super.initState();
  }
  String res="1";

  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      home: new Scaffold(
        appBar: new AppBar(
          title: const Text('Plugin example app'),
        ),
        body: new Center(
            child: new Column(
              children: <Widget>[
                new MaterialButton(onPressed: (){
                  FlutterPlugin.getPlatformVersion().then((ret){

                   setState(() {
                     print(ret);
                     res=ret;
                   });
                  });
                },child: new Text('获取安卓版本=${res}'),),


                new MaterialButton(onPressed: (){
                  FlutterPlugin.show("我是弹出框");
                },child: new Text('消息框'),),


                new MaterialButton(onPressed: (){
                  FlutterPlugin.down("我是弹出框");
                },child: new Text('迅雷下载'),),

              ],
            )
        ),
      ),
    );
  }
}
